Template matching is a general and powerful methodology in machine vision applications. It requires little user technical knowledge or interaction to achieve reasonable performance. Users need only supply template images for matching in the teaching phase. In the application phase, the template is compared to like-sized subsets of the image over a range of search positions. It is robust to linear and some monotonic nonlinear variations in shading and does not require separation of objects from their background (i.e. segmentation) that often introduces errors. Template matching methods have been extended to search an input image for instances of templates that are altered by rotation, scale, and contrast changes.
Template matching methods are primarily developed for location and identification applications. Due to the simplicity and usability, it is tempting to apply template matching to inspection applications and use the resulting matching score to check against a tolerance value for acceptance or rejection criteria. However, small uncertainties at image edges can lead to large uncertainties in image gray values. Large uncertainties in gray values due to normal edge variations in turn limit the ability of template matching methods to discriminate between defects and acceptable variations. A template matching method is least able to detect defects reliably at and around image edges, but unfortunately such edges are often the most critical for inspection because they generally correspond to physical features of the object. The near blindness of template matching method along edges is perhaps its most serious limitation for inspection applications.
Alternatively, edge detection and thresholding methods are used to detect object boundaries of interest and dimensional measurements or defect detection are performed using the detected edges. (Hanks, J, “Basic Functions Ease Entry Into Machine Vision”, Test & Measurement World, Mar. 1, 2000, Titus, J, “Software makes machine vision easier”, Test & Measurement World, Oct. 15, 2001) An edge represents gray value changes that are high-frequency components in an image. Therefore, edge detection methods are inherently sensitive to noise. Furthermore, edge detection is also sensitive to contrast variations because of its sensitivity to changes.
A structure-guided processing method uses application domain structure information to automatically enhance and detect image features of interest (Lee, S “Structure-guided image processing and image feature enhancement”, U.S. patent application Ser. No. 09/738,846, filed Dec. 15, 2000, Lee, S, Oh, S, Huang, C “Structure-guided Automatic Learning for Image Feature Enhancement”, U.S. patent application Ser. No. 09/815,466, filed May 23, 2001). The structure information compensates for severe variations such as low image contrast and noise. It retains the ability to detect true defects in the presence of severe process or sensing variations. However, the methods described only enhance regular shape structures such as straight lines, circles, circular arcs, etc. They cannot effectively detect a mismatch between the expected structures and the image features and could generate misleading results when a mismatch exists.
To perform an inspection using the prior art approach, carefully controlled inspection conditions are required. Inspection often fails in applications with significant variations.
The structure-guided inspection method of this invention overcomes the prior art limitations. It is flexible, adaptable (easy to use for a wide range of applications), can deal with noise (difficult cases) and can maximally utilize domain specific knowledge.